listbox: Make Shift-Tab work again
authorMatthias Clasen <mclasen@redhat.com>
Thu, 14 May 2020 01:45:25 +0000 (21:45 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 14 May 2020 01:45:49 +0000 (21:45 -0400)
The previous fix broke the case where we're Shift-Tabbing
from a listboxrow child to the row itself. This was causing
the widget-factory2.tab-backward test to fail. Fix it, by
grabbing the focus to the row explicitly.

gtk/gtklistbox.c

index bc4676566fd111527c3740396ffa88303d754e52..11e64e95aec32a6a03dcd42973475c33331700af 100644 (file)
@@ -2944,6 +2944,10 @@ gtk_list_box_row_focus (GtkWidget        *widget,
       /* If exiting child container to the left, select row  */
       if (direction == GTK_DIR_LEFT || direction == GTK_DIR_TAB_BACKWARD)
         {
+          /* grab focus explicitly, since gtk_list_box_row_set_focus()
+           * refuses to steal it from a child
+           */
+          gtk_widget_grab_focus (GTK_WIDGET (row));
           gtk_list_box_row_set_focus (row);
           return TRUE;
         }